import request from '@/utils/request'

// 查询抖音商品列表
export async function listGoods(query) {
  const response = await request({
    url: '/system/dygoods/list',
    method: 'get',
    params: query
  })
  return response;
}

// 查询抖音商品详细
export function getGoods(id) {
  return request({
    url: '/system/dygoods/' + id,
    method: 'get'
  })
}

// 新增抖音商品
export function addGoods(data) {
  return request({
    url: '/system/dygoods',
    method: 'post',
    data: data
  })
}

// 修改抖音商品
export function updateGoods(data) {
  return request({
    url: '/system/dygoods',
    method: 'put',
    data: data
  })
}

// 删除抖音商品
export function delGoods(id) {
  return request({
    url: '/system/dygoods/' + id,
    method: 'delete'
  })
}

// 删除抖音商品
export function syncDyGoods() {
  return request({
    url: '/system/dygoods/dataSync',
    method: 'post'
  })
}
// 删除抖音商品
export function esDyGoods() {
  return request({
    url: '/system/dygoods/saveES',
    method: 'post'
  })
}

// 查询抖音商品详细
export function stopList() {
  return request({
    url: '/system/dygoods/stopList',
    method: 'get'
  })
}

// 查询抖音商品详细
export function findState() {
  return request({
    url: '/system/dygoods/findState',
    method: 'get'
  })
}
